<template>
  <a-radio-group v-model="value" :options="options" @change="onChange"/>
</template>

<script lang="ts" setup name="smart-bool">


import {ref} from "vue";

const props = defineProps({
  modelValue: {
    type: [Boolean, null,undefined],
    required: true
  },
  trueText: {
    type: String,
    required: false,
    default: '是'
  },
  falseText: {
    type: String,
    required: false,
    default: '否'
  }
})

const options = [
  {label: props.trueText, value: true,},
  {label: props.falseText, value: false,}
]
const emit = defineEmits(['update:modelValue'])
const value = ref(props.modelValue)
const onChange = (e) => emit('update:modelValue', e)


</script>
